<template>
  <div class="app-container">
    <el-form
      :model="documentapplyFormData"
      ref="queryForm1"
      :inline="true"
      class="hear-ss"
      
    >
      <el-form-item label="文件名称:" prop="fileName">
        <el-input
          style="width: 200px"
          v-model="documentapplyFormData.fileName"
          :disabled="true"
        ></el-input>
      </el-form-item>
      <el-form-item label="秘密级别:" prop="secretLevel">
        <el-select
          style="width: 200px"
          v-model="documentapplyFormData.secretLevel"
          placeholder="请选择"
          :disabled="true"
        >
          <el-option
            v-for="dict in secretlevelOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
            :disabled="true"
          />
        </el-select>
      </el-form-item>

      <el-form-item label="文件描述:" prop="fileDesc">
        <el-input
          style="width: 200px"
          v-model="documentapplyFormData.fileDesc"
          :disabled="true"
        ></el-input>
      </el-form-item>

      <el-form-item label="修改时间:" prop="modifyTime">
        <el-date-picker
          :editable="false"
          type="date"
          v-model="documentapplyFormData.modifyTime"
          placeholder="选择日期"
          style="width: 200px"
          :disabled="true"
        ></el-date-picker>
      </el-form-item>

      <el-form-item label="文件分类:" prop="fileClassifies">
        <el-select
          v-model="documentapplyFormData.fileClassifies"
          placeholder="请选择"
          style="width: 200px"
          :disabled="true"
        >
          <el-option
            v-for="dict in fileclassifiesOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-row>
        <el-col :span="24">
          <el-form-item
            label="其他附件："
            label-width="100px"
            style="margin-left: -20px"
            prop="fileList"
          >
            <el-upload
              :on-preview="upload"
              style="margin-top: -40px"
              class="upload-demo"
              action="http://49.4.65.194:8088/test/uploadImage"
              :file-list="fileList"
              :disabled="true"
            >
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "documentApplyDetail",
  props: {
    documentapplyFormData: Object,
    isShowDocumentApply: Boolean,
    fileList: Array,
  },
  data() {
    return {
      upload: {
        headers: { Authorization: "Bearer" + getToken() },
        url: process.env.VUE_APP_BASE_API + "/test/uploadImage",
        baseUri: process.env.VUE_APP_BASE_API,
      },
      secretlevelOptions: [],
      fileclassifiesOptions: [],
      fileList: [],
    };
  },

  created() {
    this.getDicts("secret_level").then((response) => {
      this.secretlevelOptions = response.data;
    });
    this.getDicts("file_classifies").then((response) => {
      this.fileclassifiesOptions = response.data;
    });
  },
  methods: {
    upload(file) {
      this.imageUrl = this.upload.baseUri + "/iot/image/" + file.url;
      console.log(file, 666);
    },
  },
};
</script>
